Skip to main content

RandomSample

RandomSample[{e1,e2,…},n] gives a pseudorandom sample of n of the ei.

RandomSample[{w1,w2,…}->{e1,e2,…},n] gives a pseudorandom sample of n of the ei chosen using weights wi.

RandomSample[{e1,e2,…}] gives a pseudorandom permutation of the ei.

Please visit the official Wolfram Language Reference for more details and examples on core symbols.